-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boost: Add edge-cache header on WP Cloud #40557
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Boost plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
@@ -60,6 +60,9 @@ function jetpack_boost_page_optimize_service_request() { | |||
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents | |||
$etag = '"' . md5( file_get_contents( $cache_file ) ) . '"'; | |||
|
|||
if ( defined( 'IS_ATOMIC' ) && IS_ATOMIC ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think IS_ATOMIC
is defined on Pressable sites FYI.
I tried it on my test wpcom site with upgrades and I didn't see the header, but it appears to be because |
I have instead used the ATOMIC_CLIENT_ID constant, which is available on both Atomic and Pressable. However, I couldn't see the header even when I removed the condition and served the header all the time in atomic. Is the header filtered out by the edge? @thingalon I also noticed that the files aren't cached in wpcom, which is a bummer. I think this will get resolved when we start serving from static files. boost-cache directory seems to be doing just fine. @thingalon previously recommended serving from inside the uploads folder. Do you see any downsides to serving from |
I think the |
Ah, sorry I missed this last week @haqadn. :)
Yes, we strip that header out on its way through the Edge. However, you can check if a given request was cached or not by looking at the If you request the same URL a few times and see
I believe that I'm not sure which files aren't being cached on wpcom; if you can send me details, I can help out with that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on Atomic and Pressable.
Proposed changes:
Other information:
Jetpack product discussion
pfFwAW-nW-p2#comment-245
Does this pull request change what data or activity we track or use?
No
Testing instructions:
_jb_static
files that loads.A8c-Edge-Cache: cache
header should be present.